//
//  MBSpaceAgreementViewController.m
//  MiBaoTu
//
//  Created by admin on 16/9/26.
//  Copyright © 2016年 com.caesartech15. All rights reserved.
//

#import "MBSpaceAgreementViewController.h"

@interface MBSpaceAgreementViewController ()

@end

@implementation MBSpaceAgreementViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    if (self.type == AgreementType_Show) {
        [self setTitleView:@"应用介绍"];
    }
    else if (self.type == AgreementType_Agreen) {
        [self setTitleView:@"用户协议"];
    }
    [self setBackItem];
    
    [self onCreateUI];
}

#pragma mark - UI
- (void)onCreateUI
{
    
    UIWebView*webView=[[UIWebView alloc]initWithFrame:self.view.bounds];
    NSString * htmlPath;
    [self.view addSubview:webView];
    if (self.type==AgreementType_Show) {
        htmlPath = [[NSBundle mainBundle] pathForResource:@"介绍"
                                                   ofType:@"html"];
    }else{
     htmlPath = [[NSBundle mainBundle] pathForResource:@"用户协议"
                                                          ofType:@"html"];
    }
    NSString * htmlCont = [NSString stringWithContentsOfFile:htmlPath
                                                    encoding:NSUTF8StringEncoding
                                                       error:nil];
    [webView loadHTMLString:htmlCont baseURL:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
